#include<linux/module.h>
#include<linux/sched.h>
#include<linux/pid.h>
MODULE_LICENSE("GPL");
static int __init pid_nr_init(void)
{
	printk("into pid_nr_init.\n");
	struct pid * kpid=find_get_pid(current->pid);
	printk("the level of the pid is :%d\n",kpid->level);
	printk("the pid of the pid is:%d\n",kpid->numbers[kpid->level].nr);

	int nr=pid_nr(kpid);
	printk("the pid_nr result is:%d\n",nr);
	printk("the current pid is:%d\n",current->pid);
	printk("the current tgid is:%d\n",current->tgid);
	printk("out pid_nr_init.\n");
	return 0;
}
static void __exit pid_nr_exit(void)
{
	printk("Goodbye pid_nr\n");
}
module_init(pid_nr_init);
module_exit(pid_nr_exit);
